<template>
<!-- data-numbox-max='max' -->
       <div class="mui-numbox" data-numbox-min='1' data-numbox-max='max'>
					<button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
					<input @change="countChanged" ref="numbox" id="test" class="mui-input-numbox" type="number" value="1" />
					<button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
				</div>
</template>
<script>
import  mui from '../../lib/mui/js/mui.min.js'
export default{
    mounted(){
        mui('.mui-numbox').numbox().setOption("max",this.max)
        console.log("number="+this.max)
    },
    props:["max"],
    watch:{
        "max":function(newVal,oldVal){
            
        }
    },
    methods:{
        countChanged(){
            console.log(this.$refs.numbox.value)
            this.$emit("getCount",parseInt(this.$refs.numbox.value))
        }
    }
}
</script>
<style lang="scss" scoped>


</style>

